#include<bits/stdc++.h>
using namespace std;
bool check(int year){
 if((year%4==0&&year%100!=0)||year%400==0) return true;
 return false;
}
int main(){
 int m[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
 int d=6,ans=0,year=2000;int t=1;
 for(;year<=2020;year++){
  for(int i=1;i<(year==2020?13:11);i++)
  {
  	t=1;
   if(check(year)) m[2]=29;
   while(t<=m[i]){
   if(d==1||t==1) ans+=2;else ans+=1;
   t++;d++;
   if(d==8) d=1;
   }
   
  }
 }
 cout<<ans<<endl;
 return 0;
}
